﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Media;

namespace Kokomo.Environment.Documents
{
	/// <summary>
	/// Represents a tab page within a <see cref="TabbedDetailViewModel"/>
	/// </summary>
	/// <remarks>
	/// In the default view template, the header contains <see cref="IconSource"/>
	/// and <see cref="Heading"/>.  The <see cref="Content"/> object
	/// must be marked with <see cref="Kokomo.Environment.ViewTypeAttribute"/>
	/// </remarks>
	public class TabPageViewModel : NotifierObject
	{
		/// <summary>
		/// Initializes a new instance of <see cref="TabPageViewModel"/>.
		/// </summary>
		/// <param name="heading">The heading.</param>
		/// <param name="content">The content to display.</param>
		/// <param name="iconSource">The icon next to the heading.</param>
		public TabPageViewModel(
			UiString heading,
			object content,
			ImageSource iconSource = null
			)
		{
			this.Heading = heading;
			this.Content = content;
			this.IconSource = iconSource;
		}

		private UiString _heading;
		/// <summary>
		/// Gets the heading to display in the tab.
		/// </summary>
		public UiString Heading
		{
			get { return this._heading; }
			set
			{
				this._heading = value;
				this.OnPropertyChanged("Heading");
			}
		}

		private ImageSource _iconSource;
		/// <summary>
		/// Gets the icon to display in the tab next to the <see cref="Heading"/>.
		/// </summary>
		public ImageSource IconSource
		{
			get { return this._iconSource; }
			set
			{
				this._iconSource = value;
				this.OnPropertyChanged("IconSource");
			}
		}

		public object _content;
		/// <summary>
		/// The content to display.
		/// </summary>
		/// <remarks>
		/// The content object must be marked with <see cref="Kokomo.Environment.ViewTypeAttribute"/>
		/// to specify the view template.
		/// </remarks>
		public object Content
		{
			get { return this._content; }
			set
			{
				this._content = value;
				this.OnPropertyChanged("Object");
			}
		}
	}
}
